Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid escape sequence warning #93

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Fix invalid escape sequence warning #93

merged 1 commit into from
Sep 11, 2023

Conversation

benhiller
Copy link
Contributor

Summary: Python starts warning in 3.6+ about invalid escape sequences in strings. These regexes currently trigger that warning, but we can fix that easily by converting them to raw strings instead.

Test Plan: For each string changed, tested that '$str' == r'$str' in the python shell. ran tox and confirmed it still passed for py37, py38, py39 and py310

Summary: Python starts warning in 3.6+ about invalid escape sequences in
strings. These regexes currently trigger that warning, but we can fix
that easily by converting them to raw strings instead.

Test Plan: For each string changed, tested that '$str' == r'$str' in the
python shell. ran tox and confirmed it still passed for py37, py38,
py39 and py310
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #93 (fb0b88e) into main (c1855c5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #93   +/-   ##
=======================================
  Coverage   77.92%   77.92%           
=======================================
  Files           2        2           
  Lines         231      231           
=======================================
  Hits          180      180           
  Misses         51       51           
Files Changed Coverage Δ
titlecase/__init__.py 70.80% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ppannuto
Copy link
Owner

This looks great, thanks for the fix!

@ppannuto ppannuto merged commit 9c771d1 into ppannuto:main Sep 11, 2023
27 checks passed
@benhiller
Copy link
Contributor Author

Thanks for taking a look so fast!

@benhiller
Copy link
Contributor Author

By the way, would you be open to releasing a new minor version of titlecase on PyPI with this patch? Definitely not urgent, but it would be nice to be able to use the version of this library without this warning showing up.

ppannuto added a commit that referenced this pull request Sep 23, 2023
 - #93: Fix invalid escape sequence warning; thanks @benhiller!
@ppannuto
Copy link
Owner

You have remarkably good timing in when you happen to ask for things... pushed :)

@benhiller
Copy link
Contributor Author

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants